<%@ include file="/common/taglibs.jsp"%>
<%@ include file="/common/loginredirect.jsp"%>

<head>
    <title><fmt:message key="menu.js3"/></title>
    <meta name="heading" content="<fmt:message key='menu.js3'/>"/>
    <meta name="menu" content="FormsMenu"/>
</head>

<div class="jquery_tab_container">
    <span class="heading_tab advanced_link active tab1"><fmt:message key="menu.js3"/></span>
</div>

<div class="jquery_tab">
    <div class="content_block"></div>
   
<form:form commandName="disciplineProcedureForm" method="post" action="searchDisciplineProcedures" id="disciplineProcedureForm" onsubmit="return validateWork(this)">
<form:errors path="*" cssClass="error" element="div"/>
<form:hidden path="disciplineProcedure.id"/>

     <p class="buttonBar bottom"  style="border-bottom: 1px solid #ccc; margin-bottom: 10px;">
        <input class="button" type="button" style="margin-right: 5px" onclick="location.href='<c:url value="/disciplineproceduresearchform"/>'" value="<fmt:message key="button.add"/>"/>
       <input type="button" class="button" name="cancel" value="<fmt:message key="button.cancel"/>" onclick="location.href='<c:url value="/menuForms"/>'"/>
    </p>
    <h3><fmt:message key="search.discipline" /></h3><br />
    <p>
        <appfuse:label styleClass="width150 left" key="searchPerson.firstName"/>
        <form:input path="disciplineProcedure.workPosition.employment.firstName" id="disciplineProcedure.workPosition.employment.firstName"  cssClass="input-medium toCyr"  cssErrorClass="text medium error" maxlength="50"/>
    </p>
    <p>
        <appfuse:label styleClass="width150 left" key="searchPerson.lastName"/>
        <form:input path="disciplineProcedure.workPosition.employment.lastName" id="disciplineProcedure.workPosition.employment.lastName"  cssClass="input-medium toCyr" cssErrorClass="text medium error" maxlength="50"/>
    </p>
    <p>
        <appfuse:label styleClass="width150 left" key="searchPerson.socScrNo"/>
        <form:input path="disciplineProcedure.workPosition.employment.socScrNo" id="disciplineProcedure.workPosition.employment.socScrNo"   cssClass="input-medium toCyr"  cssErrorClass="text medium error" maxlength="50"/>
    </p>
    <p>
        <appfuse:label styleClass="width150 left" key="searchPerson.position"/>
        <form:input path="disciplineProcedure.workPosition.position" id="disciplineProcedure.workPosition.position"   cssClass="input-medium toCyr"  cssErrorClass="text medium error" maxlength="50"/>
    </p>
    <p>
        <appfuse:label styleClass="width150 left" key="disciplineProcedure.responsibilityType"/>
        <form:select path="disciplineProcedure.respType.id" id="responsibilityTypeSelect">
                   <form:option id="1" value="">
                    <fmt:message key="respTypeSearch"/>
                </form:option>
                <c:forEach items="${disciplineProcedureForm.responsibilityType}" var="responsibility">

                   <c:if test="${responsibility == disciplineProcedureForm.disciplineProcedure.respType}">
                        <form:option value="${responsibility.id}" id="${disciplineProcedureForm.disciplineProcedure.respType.id}" selected="true" >
                            ${responsibility.name}
                        </form:option>
                   </c:if>
                    <c:if test="${responsibility != disciplineProcedureForm.disciplineProcedure.respType}">
                        <form:option value="${responsibility.id}" id="${disciplineProcedureForm.disciplineProcedure.respType.id}" >
                            ${responsibility.name}
                        </form:option>
                    </c:if>
                </c:forEach>
         </form:select>
    </p>
    <p>
        <appfuse:label styleClass="width150 left" key="disciplineProcedure.responsibilityReason"/>
        <form:select path="disciplineProcedure.respReason.id" id="responsibilityReasonSelect">
                   <form:option id="1" value="">
                    <fmt:message key="respReasonSearch"/>
                </form:option>
                <c:forEach items="${disciplineProcedureForm.responsibilityReason}" var="responsibility">

                   <c:if test="${responsibility == disciplineProcedureForm.disciplineProcedure.respReason}">
                        <form:option value="${responsibility.id}" id="${disciplineProcedureForm.disciplineProcedure.respReason.id}" selected="true" >
                            ${responsibility.name}
                        </form:option>
                   </c:if>
                    <c:if test="${responsibility != disciplineProcedureForm.disciplineProcedure.respReason}">
                        <form:option value="${responsibility.id}" id="${disciplineProcedureForm.disciplineProcedure.respReason.id}" >
                            ${responsibility.name}
                        </form:option>
                    </c:if>
                </c:forEach>
         </form:select>
    </p>
    <p>
        <appfuse:label styleClass="width150 left" key="disciplineProcedure.measureTaken"/>
        <form:select path="disciplineProcedure.measures.id" id="measuresSelect">
                   <form:option id="1" value="">
                    <fmt:message key="measuresSearch"/>
                </form:option>
                <c:forEach items="${disciplineProcedureForm.measuresTaken}" var="measures">

                   <c:if test="${measures == disciplineProcedureForm.disciplineProcedure.measures}">
                        <form:option value="${measures.id}" id="${disciplineProcedureForm.disciplineProcedure.measures.id}" selected="true" >
                            ${measures.name}
                        </form:option>
                   </c:if>
                    <c:if test="${measures != disciplineProcedureForm.disciplineProcedure.measures}">
                        <form:option value="${measures.id}" id="${disciplineProcedureForm.disciplineProcedure.measures.id}" >
                            ${measures.name}
                        </form:option>
                    </c:if>
                </c:forEach>
         </form:select>
    </p>
 
        <appfuse:label styleClass="width150 left" key="disciplineProcedure.procDate"/>
        <form:errors path="disciplineProcedure.procDate" cssClass="fieldError"/>
        <form:input path="disciplineProcedure.procDate" value="" name="flexy_datepicker" id="disciplineProcedure.procDate" cssClass="input-medium flexy_datepicker_input" cssErrorClass="text medium error" maxlength="50"/>
   
    <br /><br />

    <p>
        <input type="submit" class="button" name="search" value="<fmt:message key="button.search"/>"/>
    </p>

</form:form>

<display:table name="searchDisciplineProceduresList" class="table" requestURI="" id="searchDisciplineProceduresList" export="false" pagesize="25">
    <display:column property="workPosition.employment.firstName" titleKey="employment.firstName" sortable="true" href="disciplineprocedureform?" media="html"
        paramId="id" paramProperty="id" />
    <display:column property="workPosition.employment.lastName" sortable="true" titleKey="basicInfo.lastName"/>
    <display:column property="workPosition.employment.fathersName" sortable="true" titleKey="basicInfo.fathersName"/>
    <display:column property="workPosition.employment.socScrNo" sortable="true" titleKey="basicInfo.socScrNo"/>
    <display:column property="workPosition.employment.gender" sortable="true" titleKey="basicInfo.gender"/>
    <display:column property="workPosition.position" sortable="true" titleKey="basicInfo.position"/>
    <display:column property="respType.name" sortable="true" titleKey="disciplineProcedure.responsibilityType"/>
    <display:column property="respReason.name" sortable="true" titleKey="disciplineProcedure.responsibilityReason"/>
    <display:column property="measures.name" sortable="true" titleKey="disciplineProcedure.measureTaken"/>
   <%-- <display:column property="procDate" sortable="true" titleKey="disciplineProcedure.procDate"/>
--%></display:table>

</div>


<v:javascript formName="disciplineProcedureForm" cdata="false" dynamicJavascript="true" staticJavascript="false"/>
<script type="text/javascript" src="<c:url value='/scripts/validator.jsp'/>"></script>

<script type="text/javascript">
    Form.focusFirstElement($('disciplineProcedureForm'));
</script>

<script type="text/javascript">
    highlightTableRows("searchDisciplineProceduresList");
</script> 